<!--
 * @Author: your name
 * @Date: 2021-10-08 09:37:42
 * @LastEditTime: 2021-12-15 14:59:52
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \ebc-admin\src\components\admin\maeesge-box.vue
-->
<template>
  <el-dialog
    :title="title"
    :visible.sync="show"
    :width="width">
    <slot />
    <slot name="footer">
      <span v-if="getIsRead" slot="footer" class="dialog-footer">
        <el-button  @click="show = false">关闭</el-button>
      </span>
      <span v-else slot="footer" class="dialog-footer">
        <el-button @click="show = false">取 消</el-button>
        <el-button type="primary" @click="$emit('submit')">确 定</el-button>
      </span>
    </slot>
  </el-dialog>
</template>

<script>
  export default {
    data() {
      return {
        show: false,
        isRed: false
      }
    },
    props: {
      title: {
        type: String,
        default: '提示'
      },
      width: {
        type:String,
        default:'60%'
      },
      isRead:{
        type:Boolean,
        default:false
      }
    },
    computed:{
      getIsRead(){
        return this.isRead
      }
    },
    methods: {
      open(isRed=false) {
        this.show = true;
        this.isRed = isRed
      },
      close() {
        this.show = false;
      }
    }
  }
</script>

<style scoped>
  ::v-deep .el-dialog{
    max-height: 60%;
    overflow: auto;
  }
</style>